<?php

class conexion {

    private $url = "localhost";
    private $dbname = "sepc";
    private $user = "postgres";
    private $password = "ingsistemas";
    private $conx;

    public function getConexionDB() {
        $this->conx = pg_connect("host=".$this->url." dbname=".$this->dbname.
                " user=".$this->user." password=".$this->password."");
        if (!$this->conx) {
            echo "No se puede realizar la Conexion";
            exit;
        }

        return $this->conx;
    }

    public function closeConexionDB() {
        pg_close($this->conx);
    }

}

?>